import request from '@/utils/request'

enum API {
  addCartUrl = '/member/cart',
  getCartUrl = '/member/cart',
  deleteCartUrl = '/member/cart',
  mergeCartUrl = '/member/cart/merge',
}
// 加入购物车
export const insertCartAPI = (data: any) =>
  request.post<any, any>(API.addCartUrl, data)
// 获取购物车数据
export const getCartAPI = () => request.get<any, any>(API.getCartUrl)
// 删除购物车数据
export const deleteCartAPI = (ids: any) =>
  request.delete<any, any>(API.deleteCartUrl, ids)
// 合并购物车
export const mergeCartAPI = (data: any) =>
  request.post<any, any>(API.mergeCartUrl, data)
